import java.lang.*;
import java.lang.Exception;

class Sender implements Runnable {
	private Channel channel1;
	private Channel channel2;
	private String myID;
	
	public Sender(Channel c1, Channel c2, String id) {
		channel1 = c1;
		channel2 = c2;
		myID = id;
	}
	
	public void run() {
		try
		{
			SelectionList sl = new SelectionList();
			sl.AddEvent(new SendEvent(channel1, "Sent from channel 1"));
			sl.AddEvent(new SendEvent(channel2, "Sent from channel 2"));
			CommEvent selected = sl.Select();
		}
		catch (InterruptedException ie) {
			System.out.println(myID + " Interrupted");
		}
	}
}
